import numpy as np
import matplotlib.pyplot as plt


#生成x
x = np.linspace(0, 2*np.pi,100)
y = np.sin(x)

#创建绘图
plt.figure(figsize=(10,6))

#绘制曲线
plt.plot(x, y, label='sin(x)', color='red')

#添加标题和标签
plt.title('Plot of sin(x) and cos(x)')
plt.xlabel('x values (radians)')
plt.ylabel('y values')
plt.legend()


plt.grid()
plt.show()


